<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>




<script>
export default {
  created() {
    // 监听路由变化，每次路由切换时滚动到页面顶部
    this.$router.beforeEach((to, from, next) => {
      window.scrollTo(0, 0);
      next();
    });

    this.$store.dispatch("fetchParentColumns");
    this.$store.dispatch("fetchSubColumns");

    // 获取视口的宽度和高度
    const viewportWidth =
      window.innerWidth || document.documentElement.clientWidth;
    const viewportHeight =
      window.innerHeight || document.documentElement.clientHeight;

    // 打印到控制台
    console.log("视口宽度：", viewportWidth);
    console.log("视口高度：", viewportHeight);
  },
};
</script>

<style>
* {
  margin: 0px;
}

#app{
  min-width: 1520px;
}


</style>
